﻿<vsx.ui:DialogWindow x:Class="Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.UI.CodeAnalysisProgressWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:vsx.ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.10.0"
                     xmlns:local.ui="clr-namespace:Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.UI"
                     xmlns:local.converter="clr-namespace:Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.UI.Converters"
                     xmlns:local.viewmodels="clr-namespace:Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.ViewModels"
                     x:Name="this"
                     Title="Code Analysis Progress"
                     HasMinimizeButton="False"
                     HasMaximizeButton="False"
                     WindowStartupLocation="CenterOwner"
                     MinHeight="400" Height="400" MinWidth="750" Width="750">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Margin="5">
            <TextBlock.Text>
                <Binding Path="FxCopVersion" StringFormat="Using FxCop Version : {0}">
                    <Binding.Converter>
                        <local.converter:FxCopVersionConverter/>
                    </Binding.Converter>
                </Binding>
            </TextBlock.Text>
        </TextBlock>
        <ListView Grid.Row="1" ItemsSource="{Binding Analyses}" Margin="0,0,0,5">
            <ListView.View>
                <GridView>
                    <GridViewColumn>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Image Width="16" Height="16" Margin="2">
                                    <Image.Style>
                                        <Style TargetType="Image">
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static local.viewmodels:CodeAnalysisStatus.Pending}">
                                                    <Setter Property="Visibility" Value="Hidden"/>
                                                </DataTrigger>
                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static local.viewmodels:CodeAnalysisStatus.Analyzing}">
                                                    <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/CodeAnalyzing.png"/>
                                                </DataTrigger>
                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static local.viewmodels:CodeAnalysisStatus.Completed}">
                                                    <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/CodeAnalysisCompleted.png"/>
                                                </DataTrigger>
                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static local.viewmodels:CodeAnalysisStatus.Failed}">
                                                    <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/CodeAnalysisFailed.png"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Image.Style>
                                </Image>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="Target" DisplayMemberBinding="{Binding Target}" Width="300"/>
                    <GridViewColumn Header="Message" Width="350">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Message}" TextWrapping="Wrap"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <Grid Grid.Row="2">
            <CheckBox IsEnabled="False" Visibility="Collapsed" ToolTip="AUTO_CLOSE is not implemented yet.">Close when code analysis has completed</CheckBox>
            <Button Padding="10,0" HorizontalAlignment="Right" Click="Cancel">Cancel</Button>
        </Grid>
    </Grid>
</vsx.ui:DialogWindow>
